<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.language.Equivalence.make</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d1/d8b/classnars_1_1language_1_1Equivalence_ad5069483330bc875fbb48a1e992f7bf7.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="ad5069483330bc875fbb48a1e992f7bf7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../d1/d8b/classnars_1_1language_1_1Equivalence.html">Equivalence</a> nars.language.Equivalence.make </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d8/db8/classnars_1_1language_1_1Term.html">Term</a>&#160;</td>
          <td class="paramname"><em>subject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d8/db8/classnars_1_1language_1_1Term.html">Term</a>&#160;</td>
          <td class="paramname"><em>predicate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d8/df4/classnars_1_1storage_1_1Memory.html">Memory</a>&#160;</td>
          <td class="paramname"><em>memory</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Try to make a new compound from two components. </p>
<p>Called by the inference rules. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">subject</td><td>The first component </td></tr>
    <tr><td class="paramname">predicate</td><td>The second component </td></tr>
    <tr><td class="paramname">memory</td><td>Reference to the memory </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A compound generated or null </dd></dl>

<p>Definition at line <a class="el" href="../../d3/dcc/Equivalence_8java_source.html#l00067">67</a> of file <a class="el" href="../../d3/dcc/Equivalence_8java_source.html">Equivalence.java</a>.</p>

<p>References <a class="el" href="../../d5/d0e/CompoundTerm_8java_source.html#l00222">nars.language.CompoundTerm.argumentsToList()</a>, <a class="el" href="../../d8/df2/Term_8java_source.html#l00138">nars.language.Term.compareTo()</a>, <a class="el" href="../../d3/dcc/Equivalence_8java_source.html#l00037">nars.language.Equivalence.Equivalence()</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00077">nars.io.Symbols.EQUIVALENCE_RELATION</a>, <a class="el" href="../../d2/d44/Statement_8java_source.html#l00191">nars.language.Statement.invalidStatement()</a>, <a class="el" href="../../d2/d44/Statement_8java_source.html#l00173">nars.language.Statement.makeStatementName()</a>, <a class="el" href="../../d8/df2/Term_8java_source.html#l00046">nars.language.Term.name</a>, and <a class="el" href="../../db/d0c/Memory_8java_source.html#l00152">nars.storage.Memory.nameToListedTerm()</a>.</p>

<p>Referenced by <a class="el" href="../../d0/db7/LocalRules_8java_source.html#l00217">nars.inference.LocalRules.inferToSym()</a>, <a class="el" href="../../d4/d15/CompositionalRules_8java_source.html#l00345">nars.inference.CompositionalRules.introVarOuter()</a>, <a class="el" href="../../d2/d44/Statement_8java_source.html#l00068">nars.language.Statement.make()</a>, and <a class="el" href="../../d2/d44/Statement_8java_source.html#l00128">nars.language.Statement.makeSym()</a>.</p>
<div class="fragment"><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                                                                                {  <span class="comment">// to be extended to check if subject is Conjunction</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordflow">if</span> ((subject instanceof Implication) || (subject instanceof <a class="code" href="../../d1/d8b/classnars_1_1language_1_1Equivalence_a0b0aac062c08a1cefa084bfec24386d2.html#a0b0aac062c08a1cefa084bfec24386d2">Equivalence</a>)) {</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        }</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keywordflow">if</span> ((predicate instanceof Implication) || (predicate instanceof Equivalence)) {</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        }</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="../../d1/d5e/classnars_1_1language_1_1Statement_a96d4bf7bb99f48b6496cdb7457bc0e50.html#a96d4bf7bb99f48b6496cdb7457bc0e50">invalidStatement</a>(subject, predicate)) {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="keywordflow">return</span> null;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keywordflow">if</span> (subject.compareTo(predicate) &gt; 0) {</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            <a class="code" href="../../d8/db8/classnars_1_1language_1_1Term_a2d9973aada6190dd60b48a34448094c9.html#a2d9973aada6190dd60b48a34448094c9">Term</a> interm = subject;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            subject = predicate;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            predicate = interm;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        }</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        String <a class="code" href="../../d8/db8/classnars_1_1language_1_1Term_a059f44677d4580c0eef198dfba957b6b.html#a059f44677d4580c0eef198dfba957b6b">name</a> = <a class="code" href="../../d1/d5e/classnars_1_1language_1_1Statement_a7123aba1c8c566f291e2c9b9d147557d.html#a7123aba1c8c566f291e2c9b9d147557d">makeStatementName</a>(subject, Symbols.EQUIVALENCE_RELATION, predicate);</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <a class="code" href="../../d8/db8/classnars_1_1language_1_1Term_a2d9973aada6190dd60b48a34448094c9.html#a2d9973aada6190dd60b48a34448094c9">Term</a> t = memory.nameToListedTerm(name);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordflow">if</span> (t != null) {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="keywordflow">return</span> (Equivalence) t;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        }</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        ArrayList&lt;Term&gt; argument = <a class="code" href="../../d0/dee/classnars_1_1language_1_1CompoundTerm_a26cc2a0123b22a3019ca81de239c5007.html#a26cc2a0123b22a3019ca81de239c5007">argumentsToList</a>(subject, predicate);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="../../d1/d8b/classnars_1_1language_1_1Equivalence_a0b0aac062c08a1cefa084bfec24386d2.html#a0b0aac062c08a1cefa084bfec24386d2">Equivalence</a>(argument);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1language_1_1Term_a2d9973aada6190dd60b48a34448094c9_html_a2d9973aada6190dd60b48a34448094c9"><div class="ttname"><a href="../../d8/db8/classnars_1_1language_1_1Term_a2d9973aada6190dd60b48a34448094c9.html#a2d9973aada6190dd60b48a34448094c9">nars.language.Term.Term</a></div><div class="ttdeci">Term()</div><div class="ttdoc">Default constructor that build an internal Term. </div><div class="ttdef"><b>Definition:</b> <a href="../../d8/df2/Term_8java_source.html#l00051">Term.java:51</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1CompoundTerm_a26cc2a0123b22a3019ca81de239c5007_html_a26cc2a0123b22a3019ca81de239c5007"><div class="ttname"><a href="../../d0/dee/classnars_1_1language_1_1CompoundTerm_a26cc2a0123b22a3019ca81de239c5007.html#a26cc2a0123b22a3019ca81de239c5007">nars.language.CompoundTerm.argumentsToList</a></div><div class="ttdeci">static ArrayList&lt; Term &gt; argumentsToList(Term t1, Term t2)</div><div class="ttdoc">build a component list from two terms </div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d0e/CompoundTerm_8java_source.html#l00222">CompoundTerm.java:222</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1Equivalence_a0b0aac062c08a1cefa084bfec24386d2_html_a0b0aac062c08a1cefa084bfec24386d2"><div class="ttname"><a href="../../d1/d8b/classnars_1_1language_1_1Equivalence_a0b0aac062c08a1cefa084bfec24386d2.html#a0b0aac062c08a1cefa084bfec24386d2">nars.language.Equivalence.Equivalence</a></div><div class="ttdeci">Equivalence(ArrayList&lt; Term &gt; components)</div><div class="ttdoc">Constructor with partial values, called by make. </div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dcc/Equivalence_8java_source.html#l00037">Equivalence.java:37</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1Term_a059f44677d4580c0eef198dfba957b6b_html_a059f44677d4580c0eef198dfba957b6b"><div class="ttname"><a href="../../d8/db8/classnars_1_1language_1_1Term_a059f44677d4580c0eef198dfba957b6b.html#a059f44677d4580c0eef198dfba957b6b">nars.language.Term.name</a></div><div class="ttdeci">String name</div><div class="ttdoc">A Term is identified uniquely by its name, a sequence of characters in a given alphabet (ASCII or Uni...</div><div class="ttdef"><b>Definition:</b> <a href="../../d8/df2/Term_8java_source.html#l00046">Term.java:46</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1Statement_a7123aba1c8c566f291e2c9b9d147557d_html_a7123aba1c8c566f291e2c9b9d147557d"><div class="ttname"><a href="../../d1/d5e/classnars_1_1language_1_1Statement_a7123aba1c8c566f291e2c9b9d147557d.html#a7123aba1c8c566f291e2c9b9d147557d">nars.language.Statement.makeStatementName</a></div><div class="ttdeci">static String makeStatementName(TermStruct subject, String relation, TermStruct predicate)</div><div class="ttdoc">Default method to make the nameStr of an image term from given fields. </div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d44/Statement_8java_source.html#l00173">Statement.java:173</a></div></div>
<div class="ttc" id="classnars_1_1language_1_1Statement_a96d4bf7bb99f48b6496cdb7457bc0e50_html_a96d4bf7bb99f48b6496cdb7457bc0e50"><div class="ttname"><a href="../../d1/d5e/classnars_1_1language_1_1Statement_a96d4bf7bb99f48b6496cdb7457bc0e50.html#a96d4bf7bb99f48b6496cdb7457bc0e50">nars.language.Statement.invalidStatement</a></div><div class="ttdeci">static boolean invalidStatement(Term subject, Term predicate)</div><div class="ttdoc">Check the validity of a potential Statement. </div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d44/Statement_8java_source.html#l00191">Statement.java:191</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d1/d8b/classnars_1_1language_1_1Equivalence_ad5069483330bc875fbb48a1e992f7bf7_ad5069483330bc875fbb48a1e992f7bf7_cgraph.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

<p><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d1/d8b/classnars_1_1language_1_1Equivalence_ad5069483330bc875fbb48a1e992f7bf7_ad5069483330bc875fbb48a1e992f7bf7_icgraph.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../d0/d72/namespacenars_1_1language.html">language</a></li><li class="navelem"><a class="el" href="../../d1/d8b/classnars_1_1language_1_1Equivalence.html">Equivalence</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
